﻿using System;
using NUnit.Framework;

namespace RESTController.Lib
{
    [TestFixture]
    public class PageCountCalculatorTests
    {
        [Test]
        public void CalculateNumberOfPages_WhenPageSizeIsLessThan0_ThrowsException()
        {
            Assert.Throws<ArgumentException>(() => PageCountCalculator.CalculateNumberOfPages(-1, 10));
        }

        [Test]
        [TestCase(10, 0, Result = 1)]
        [TestCase(10, 10, Result = 1)]
        [TestCase(10, 11, Result = 2)]        
        [TestCase(10, 21, Result = 3)]
        [TestCase(10, 100, Result = 10)]
        public int CalculateNumberOfPages_ReturnsExpectedResult(int pageSize, int totalCount)
        {
            return PageCountCalculator.CalculateNumberOfPages(pageSize, totalCount);
        }
    }
}
